
namespace Core.GameObjects.Stats
{
    /// <summary>
    /// Information about one stat for an Entity
    /// </summary>
    public class EntityStat
    {
        private Stat _Stat;
        private int _CurrentValue;

        public EntityStat(Stat Stat, int value)
        {
            _Stat = Stat;
            _CurrentValue = value;
        }

        public int CurrentValue
        {
            get { return _CurrentValue; }
        }

        public Stat StatInfo
        {
            get { return _Stat; }
        }

        public void IncreaseStat(int val)
        {
            _CurrentValue += val;
            if (_CurrentValue > Stat.MAX_STAT_VALUE)
                _CurrentValue = Stat.MAX_STAT_VALUE;
        }

        public void ReduceStat(int val)
        {
            _CurrentValue -= val;
            if (_CurrentValue < 1)
                _CurrentValue = 1;
        }
    }
}
